package com.ourteam.system.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Thu Jul 12 16:34:06 CST 2018
 * Auto Generate Date : 2018-07-20 12:04:57
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class SystemUserRoleRelate implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("expiredDate",
            com.ourteam.system.dao.ISysUserRoleRelateDAO.ExpiredDate);

        mappedDaoFields.put("id",
            com.ourteam.system.dao.ISysUserRoleRelateDAO.Id);

        mappedDaoFields.put("remarks",
            com.ourteam.system.dao.ISysUserRoleRelateDAO.Remarks);

        mappedDaoFields.put("roleId",
            com.ourteam.system.dao.ISysUserRoleRelateDAO.RoleId);

        mappedDaoFields.put("roleType",
            com.ourteam.system.dao.ISysUserRoleRelateDAO.RoleType);

        mappedDaoFields.put("status",
            com.ourteam.system.dao.ISysUserRoleRelateDAO.Status);

        mappedDaoFields.put("userId",
            com.ourteam.system.dao.ISysUserRoleRelateDAO.UserId);

        mappedDaoFields.put("roleCode",
            com.ourteam.system.dao.ISysUserRoleRelateDAO.RoleCode);

        mappedDaoFields.put("roleName",
            com.ourteam.system.dao.ISysUserRoleRelateDAO.RoleName);

        mappedDaoFields.put("domainId",
            com.ourteam.system.dao.ISysUserRoleRelateDAO.DomainId);

        mappedDaoFields.put("domainCode",
            com.ourteam.system.dao.ISysUserRoleRelateDAO.DomainCode);

        mappedDaoFields.put("domainName",
            com.ourteam.system.dao.ISysUserRoleRelateDAO.DomainName);
    }

    private com.ourteam.system.dao.SysUserRoleRelate sysUserRoleRelate;

    public SystemUserRoleRelate() {
        super();

        this.sysUserRoleRelate = new com.ourteam.system.dao.SysUserRoleRelate();
    }

    public SystemUserRoleRelate(
        com.ourteam.system.dao.SysUserRoleRelate sysUserRoleRelate) {
        super();

        this.sysUserRoleRelate = sysUserRoleRelate;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(sysUserRoleRelate);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.system.dao.SysUserRoleRelate convertToSysUserRoleRelate() {
        return this.sysUserRoleRelate;
    }

    public com.ourteam.system.dao.SysUserRoleRelate convertTo() {
        return this.sysUserRoleRelate;
    }

    /**
     * Get expiredDate
     *
     * @return java.util.Date
     */
    public java.util.Date getExpiredDate() {
        return (java.util.Date) this.sysUserRoleRelate.getExpiredDate();
    }

    /**
     * Set expiredDate
     *
     * @parameter java.util.Date
     */
    public void setExpiredDate(java.util.Date expiredDate) {
        this.sysUserRoleRelate.setExpiredDate(expiredDate);
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.sysUserRoleRelate.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.sysUserRoleRelate.setId(id);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.sysUserRoleRelate.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.sysUserRoleRelate.setRemarks(remarks);
    }

    /**
     * Get roleId
     *
     * @return long
     */
    public long getRoleId() {
        return (long) this.sysUserRoleRelate.getRoleId();
    }

    /**
     * Set roleId
     *
     * @parameter long
     */
    public void setRoleId(long roleId) {
        this.sysUserRoleRelate.setRoleId(roleId);
    }

    /**
     * Get roleType
     *
     * @return String
     */
    public String getRoleType() {
        return (String) this.sysUserRoleRelate.getRoleType();
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.sysUserRoleRelate.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.sysUserRoleRelate.setStatus(status);
    }

    /**
     * Get userId
     *
     * @return long
     */
    public long getUserId() {
        return (long) this.sysUserRoleRelate.getUserId();
    }

    /**
     * Set userId
     *
     * @parameter long
     */
    public void setUserId(long userId) {
        this.sysUserRoleRelate.setUserId(userId);
    }

    /**
     * Get roleCode
     *
     * @return String
     */
    public String getRoleCode() {
        return (String) this.sysUserRoleRelate.getRoleCode();
    }

    /**
     * Get roleName
     *
     * @return String
     */
    public String getRoleName() {
        return (String) this.sysUserRoleRelate.getRoleName();
    }

    /**
     * Get domainId
     *
     * @return long
     */
    public long getDomainId() {
        return (long) this.sysUserRoleRelate.getDomainId();
    }

    /**
     * Get domainCode
     *
     * @return String
     */
    public String getDomainCode() {
        return (String) this.sysUserRoleRelate.getDomainCode();
    }

    /**
     * Get domainName
     *
     * @return String
     */
    public String getDomainName() {
        return (String) this.sysUserRoleRelate.getDomainName();
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof SystemUserRoleRelate) == false) {
            return false;
        } // end if

        SystemUserRoleRelate other = (SystemUserRoleRelate) obj;

        boolean isEqual = false;

        com.ourteam.system.dao.SysUserRoleRelate tempSysUserRoleRelate = other.convertToSysUserRoleRelate();

        if ((tempSysUserRoleRelate == null) ||
                (this.sysUserRoleRelate == null)) {
            isEqual = false;
        } else if ((tempSysUserRoleRelate == this.sysUserRoleRelate) ||
                tempSysUserRoleRelate.equals(this.sysUserRoleRelate)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static SystemUserRoleRelate[] toArray(
        com.ourteam.system.dao.SysUserRoleRelate[] aSysUserRoleRelates) {
        return toArray(aSysUserRoleRelates, null);
    }

    public static SystemUserRoleRelate[] toArray(
        com.ourteam.system.dao.SysUserRoleRelate[] aSysUserRoleRelates,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aSysUserRoleRelates)) {
            return new SystemUserRoleRelate[0];
        }

        int length = aSysUserRoleRelates.length;

        SystemUserRoleRelate[] beans = new SystemUserRoleRelate[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new SystemUserRoleRelate(aSysUserRoleRelates[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aSysUserRoleRelates[i] });
            }
        }

        return beans;
    }
}
